<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
    <div class="container">
        <a type="button" class="btn btn-success" href="/add">添加数据</a>
        <h2>用户管理</h2>
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>用户名</th>
                    <th>密码</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {{each data}}
                <tr>
                    <td>{{$index+1}}</td>
                    <td>{{$value.name}}</td>
                    <td>{{$value.pwd}}</td>
                    <td>
                        <a type="button" class="btn btn-danger" href="/doDelete?id={{@ $value._id}}" >删除</a>
                        <a type="button" class="btn btn-warning" href="/edit?id={{@ $value._id}}">修改</a>
                    </td>
                </tr>
                {{/each}}
            </tbody>
        </table>
    </div>
</body>
</html>